import 'package:flutter/material.dart';
import 'package:flutter_demo_app/componet/draggable_widget.dart';

class draggableWidgetPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => videoPreviewState();
}

class videoPreviewState extends State<draggableWidgetPage> {
  String _draggableColor = '(80.0, 80.0)';

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: new AppBar(
        backgroundColor: Colors.deepOrange,
        elevation: 0.0,
        title: new Text(
          "draggableWidgetPage",
          style: new TextStyle(
              color: Colors.white,
              fontSize: 18.0,
              fontWeight: FontWeight.normal),
        ),
      ),
      body: new Stack(
        children: <Widget>[
          DraggableWidget(
            offset: Offset(80.0, 80.0),
            widgetColor: Colors.tealAccent,
          ),
          DraggableWidget(
            offset: Offset(180.0, 80.0),
            widgetColor: Colors.redAccent,
          ),
          Center(
            child: DragTarget(
              onAccept: (Offset ) {
                _draggableColor = Offset;
              },
              builder: (context, candidateData, rejectedData) {
                return Row(
//                  width: 100.0,
//                  height: 100.0,
                 // offset: _draggableColor,
                );
              },
            ),
          ),
        ],
      ),
    );
  }
}
